package com.zmzncs.lmtc.module.order.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zmzncs.lmtc.module.order.pojo.order_Info.CarInModel;
import com.zmzncs.lmtc.module.order.pojo.order_Info.OrderInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zmzncs.lmtc.module.order.pojo.order_Info.OrderInfoDTO;
import com.zmzncs.lmtc.module.order.pojo.order_Info.OrderInfoManageForm;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 客户-信息 Mapper 接口
 * </p>
 *
 * @author 任建波
 * @since 2020-09-01
 */
@Repository
public interface OrderInfoDao extends BaseMapper<OrderInfo> {

    /**获取客户计费停车时长*/
    Double getCustomerChargeParkDuration(Long customerId);
    /**获取客户车的计费停车时长*/
    Double getCustomerCarChargeParkDuration(Long customerId, Long carId);

    OrderInfo selectByOrderCode(String orderCode);

    OrderInfo selectWaitLeaveOrderByCustomerId(Long customerId, Integer status);


    /** 订单分页查询*/
    IPage<OrderInfoDTO> getOrderList(Page page, @Param("form") OrderInfoManageForm form);

    List<OrderInfoDTO> selectListByOrderCode(String orderCode);

    /**大数据展示——获取入场记录*/
    List<CarInModel> getCarInList();

    /**查询车辆的停车总时长*/
    Double getSumParkDuration(String carNum);

    /**根据交易编号 查询订单*/
    List<OrderInfoDTO> selectListByTradeNo(String tradeNo);

    /**根据停车场Id查询信息*/
    List<OrderInfoDTO> getOrderByParkId(Long parkId);

}
